//
//  UIViewController+YTAdd.h
//  tesDemo02
//
//  Created by 拓客营 on 2022/3/22.
//

#import <UIKit/UIKit.h>
#import <TZImagePickerController/TZImagePickerController.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^imagePickerCallback)(NSError *_Nullable error, UIImage *_Nullable image);
typedef void(^albumControllerCallback)(NSArray<UIImage *> *photos);
typedef void(^AlbumControllerAssetsCallback)(NSArray<UIImage *> *photos, NSArray *assets);

@interface UIViewController (YTAdd)

- (void)dismissController;

- (void)popController;

- (void)setTitle:(nullable NSString *)title titleColor:(UIColor *)color;

/// 自定义模态跳转
- (void)yt_presentViewController:(UIViewController *)controller animated:(BOOL)flag completion:(nullable void (^)(void))completion;


- (void)presentImagePickerControllerWithCallback:(nullable imagePickerCallback)callback;

/// 录制
- (void)presentRecordImagePickerControllerWithDelegator:(id<UIImagePickerControllerDelegate, UINavigationControllerDelegate>)delegate;

/// 拍照
- (void)presentImagePickerControllerWithDelegator:(id <UIImagePickerControllerDelegate,  UINavigationControllerDelegate>)delegate;

/// 相册 图片是否有切割
- (void)presentAlbumControllerWithDelegate:(id <TZImagePickerControllerDelegate>)delegate max:(NSInteger)max callback:(nullable albumControllerCallback)callback isClip:(BOOL)isClicp;

/// 相册 设置切割大小
- (void)presentAlbumControllerWithDelegate:(id<TZImagePickerControllerDelegate>)delegate max:(NSInteger)max callback:(albumControllerCallback)callback clipSize:(CGSize)clipSize;

/// 相册
- (void)presentAlbumAndVideoControllerWithDelegate:(id<TZImagePickerControllerDelegate> )delegate max:(NSInteger)max callback:(AlbumControllerAssetsCallback)callback;

- (void)isNeedRotation:(BOOL)needRotation;

// 为类别添加属性
@property (nonatomic, strong) TZImagePickerController *pickerController;

@end

NS_ASSUME_NONNULL_END
